<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>运行时配置</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="zlib.installation.html">« 安装</a></li>
      <li style="float: right;"><a href="zlib.resources.html">资源类型 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="zlib.setup.html">安装/配置</a></li>
    <li>运行时配置</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="zlib.configuration" class="section">
 <h2 class="title">运行时配置</h2>
 <p class="simpara">
这些函数的行为受 <var class="filename">php.ini</var> 中的设置影响。
</p>
 <p class="para">
  The zlib extension offers the option to transparently compress
  your pages on-the-fly, if the requesting browser supports
  this. Therefore there are three options in the <a href="configuration.file.html" class="link">configuration file</a> <var class="filename">php.ini</var>.
   <table class="doctable table">
   <caption><strong>Zlib Configuration Options</strong></caption>
   
    <thead>
     <tr>
      <th>名字</th>
      <th>默认</th>
      <th>可修改范围</th>
      <th>更新日志</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><a href="zlib.configuration.html#ini.zlib.output-compression" class="link">zlib.output_compression</a></td>
      <td>&quot;0&quot;</td>
      <td>PHP_INI_ALL</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><a href="zlib.configuration.html#ini.zlib.output-compression-level" class="link">zlib.output_compression_level</a></td>
      <td>&quot;-1&quot;</td>
      <td>PHP_INI_ALL</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><a href="zlib.configuration.html#ini.zlib.output-handler" class="link">zlib.output_handler</a></td>
      <td>&quot;&quot;</td>
      <td>PHP_INI_ALL</td>
      <td class="empty">&nbsp;</td>
     </tr>

    </tbody>
   
  </table>

   有关 PHP_INI_* 样式的更多详情与定义，见 <a href="configuration.changes.modes.html" class="xref">配置可被设定范围</a>。
</p>
 
 <p class="para">这是配置指令的简短说明。</p>
 
 <p class="para">
 <dl>
  
   <dt id="ini.zlib.output-compression">
    <code class="parameter">zlib.output_compression</code>
    <span class="type">bool</span>/<span class="type">int</span>
   </dt>

   <dd>

    <p class="para">
     Whether to transparently compress pages. If this option is set
     to &quot;On&quot; in <var class="filename">php.ini</var> or the Apache configuration, pages are
     compressed if the browser sends an &quot;Accept-Encoding: gzip&quot; or
     &quot;deflate&quot; header. &quot;Content-Encoding: gzip&quot; (respectively
     &quot;deflate&quot;) and &quot;Vary: Accept-Encoding&quot; headers are added to
     the output.
     In runtime, it can be set only before sending any output.
    </p>
    <p class="para">
     This option also accepts integer values instead of boolean
     &quot;On&quot;/&quot;Off&quot;, using this you can set the output buffer size
     (default is 4KB).
    </p>
    <blockquote class="note"><p><strong class="note">注意</strong>: 
     <p class="para">
      <a href="outcontrol.configuration.html#ini.output-handler" class="link">output_handler</a> must be 
      empty if this is set &#039;On&#039; ! Instead you must use <code class="literal">zlib.output_handler</code>.
     </p>
    </p></blockquote>
   </dd>

  

  
   <dt id="ini.zlib.output-compression-level">
    <code class="parameter">zlib.output_compression_level</code>
    <span class="type">int</span>
   </dt>

   <dd>

    <p class="para">
     Compression level used for transparent output compression. Specify a
     value between 0 (no compression) to 9 (most compression). The default
     value, -1, lets the server decide which level to use.
    </p>
   </dd>

  

  
   <dt id="ini.zlib.output-handler">
    <code class="parameter">zlib.output_handler</code>
    <span class="type">string</span>
   </dt>

   <dd>

    <p class="para">
     You cannot specify additional output handlers if zlib.output_compression
     is activated here. This setting does the same as <a href="outcontrol.configuration.html#ini.output-handler" class="link">
     output_handler</a> but in a different order.
    </p>
   </dd>

  

 </dl>

 </p>
</div></div></div></body></html>